import collections


class MapBase(collections.MutableMapping):
    """映射基类"""

    class _Item:
        __slots__ = '_key', '_value'

        def __init__(self, key, value):
            self._key = key
            self._value = value

        def __eq__(self, other):
            return self._key == other._key

        def __ne__(self, other):
            return not (self._key == other._key)

        def __lt__(self, other):
            return self._key < other._key
